home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Tools (InfoMagic)
/
Internet Tools.iso
/
dos_win
/
winsock
/
maillist
/
94-05.Z
/
94-05
/
000000_junodj@css583.gordon.army.mil_Sun May 1 06:37:42 1994.msg
next >
Wrap
Internet Message Format
|
1994-05-31
|
2KB
Received: from SLIP1.CSS.GORDON.ARMY.MIL ([147.51.202.2]) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
id AA20815; Sun, 1 May 1994 13:04:58 -0400
Date: Sun, 1 May 94 11:37:42 EST
Message-Id: <9405011137.AA18296@SLIP1.CSS.GORDON.ARMY.MIL>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
From: "John A. Junod" <junodj@css583.gordon.army.mil>
Reply-To: <junodj@css583.gordon.army.mil>
Sender: <junodj@SLIP1.CSS.GORDON.ARMY.MIL>
To: winsock@sunsite.unc.edu
Subject: problem with MS VXD TCP-IP eating file handles
X-Mailer: <IMAIL v94.04.28>
Seems to be a little problem with the MS resolver routines in
the following case.
struct hostent FAR *pHostEntry;
SOCKADDR_IN sa;
if((pHostEntry=gethostbyname(hostname))!=NULL)
{
// do something...
} else if((sa.sin_addr.s_addr=inet_addr(hostname))!=INADDR_NONE)
// do something else..
When the host name is a string that doesn't get resolved in the
first "gethostbyname()" call, it will leave a file handle open
when the inet_addr is called. Of course, you only get 20 file
handles by default in a Windows program, so your program can
run out of file handles rather quickly. (reported to MS)
Looks like you have to determine if your "hostname" is a valid
IP address BEFORE you call inet_addr!
John
---------------------------------------------------------------
| John A. Junod | 72321.366@compuserve.com |
| 267 Hillwood Street | --> junodj@css583.gordon.army.mil |
| Martinez, GA, 30907 | zj8549@trotter.usma.edu |
| (706)-860-2671 | |
---------------------(sent by IMAIL)---------------------------